package com.xiaolun.builder.demo2;

/**
 * @Author 硕鼠
 * @Date 2020/5/22 10:01
 * @Version 1.0
 * @Description 文件说明
 */
//具体的建造者：工人（完成这些步骤，返回产品）
public class Worker extends Builder {
    private Product product; //需要完成的产品

    public Worker() {
        product = new Product();
    }

    @Override
    Builder builderA(String msg) {
        product.setBuildA(msg);
        return this;
    }

    @Override
    Builder builderB(String msg) {
        product.setBuildB(msg);
        return this;
    }

    @Override
    Builder builderC(String msg) {
        product.setBuildC(msg);
        return this;
    }

    @Override
    Builder builderD(String msg) {
        product.setBuildD(msg);
        return this;
    }

    @Override
    Product getProduct() {
        return product;
    }
}
